<?php
require_once '../../library/config.php';
require_once '../library/functions.php';

	if (isset($_GET['truong_id']) && $_GET['truong_id'] > 0) {
	$truong_id = (int)$_GET['truong_id'];
	} 
	$sql2 = "SELECT id, tendv
							FROM donvi
							WHERE truong_id = $truong_id and hieu_luc = 1";
	$result = dbQuery($sql2) ;

	$list = '<option value="-1" selected>--Chọn đơn vị--</option>';
	
	while($row = dbFetchArray($result)) {
		list($id, $name) = $row;
		$list .= "<option value=\"$id\"";
		$list .= ">$name</option>\r\n";
	}	
	echo $list;
?>